function DecomposeFrequencyBands
% Display a plot of binned frequencies from an ERSP plot

X = load('D:\ECoG\Results\ERSP\DS-T30 FaceHouse Response 4-200Hz.mat');

series = zeros(size(X.ersp,2), 5);
series(:,1) = mean(X.ersp(X.freqs>4 & X.freqs<7,:),1)';
series(:,2) = mean(X.ersp(X.freqs>7 & X.freqs<13,:),1)';
series(:,3) = mean(X.ersp(X.freqs>13 & X.freqs<30,:),1)';
series(:,4) = mean(X.ersp(X.freqs>30 & X.freqs<70,:),1)';
series(:,5) = mean(X.ersp(X.freqs>70 & X.freqs<130,:),1)';
plot (series, 'LineWidth', 3);
legend('4-7Hz','7-13Hz','13-30Hz','30-70Hz','70-130Hz');
xlabel({'Time'});
ylabel({'Pwr'});
set(gca,'XTick',0:100:1000);
set(gca,'XTickLabel',{'-500ms', '-400ms','-300ms', '-200ms','-100ms', 'Marker','100ms', '200ms','300ms', '400ms', '500ms'});
set(gca,'XGrid','on');


end

